<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS_函数</title>
    <script>
    function $(id){return.getElementById(id);}
        window.onload=function(){
        document.getElementById("a1").addEventlistener("click",function(e){
        e.preventDefault();
        })
        function fun1(e){
        e.preventDefault();
        return false;
        }

        $("div1").addEventListener("copy",function(){
        alert("please login")}
        })

        }
    </script>
</head>
<body>
<a href="#" id="a1">baidu</a>
 <div id="div1">
     this is a div<br>
     this is a div<br>
     this is a div<br>
     this is a div<br>
     this is a div<br>
     this is a div<br>

 </div>
</body>
</html>